#cm-modal-portal {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}
.cm-modal-wrap {
    justify-content: center;
    align-items: center;
    position: fixed;
    pointer-events: none;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    outline: none;
    display: none;
    &.cm-modal-visible {
        display: flex;
        z-index: 5000;
        .cm-draggable {
            pointer-events: all;
        }
    }
    .cm-draggable {
        position: absolute;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
    }
    &.cm-modal-open {
        .cm-draggable {
            opacity: 1;
        }
    }
    &.cm-modal-fullscreen {
        .cm-draggable {
            top: 0!important;
            left: 0!important;
            right: 0!important;
            bottom: 0!important;
            transform: translate(0, 0)!important;
        }
        .cm-modal {
            min-width: 100%;
            min-height: 100%;
        }
    }
}
.cm-modal-mask{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4000;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    background: rgba(0,0,0,.2);
    opacity: 0;
    pointer-events: none;
    &.cm-modal-mask-visible {
        visibility: visible;
        display: block;
        opacity: 1;
        pointer-events: all;
    }
}

.cm-modal{
    position: relative;
    border-radius: var(--cui-border-radius-small);
    flex-direction: column;
    min-width: 40vw;
    min-height: 0vh;
    background-color: var(--cui-color-bg-3);
    display: flex;
    transition: all 0.05s linear;
    -webkit-box-shadow: var(--cui-shadow-elevated);
    -moz-box-shadow: var(--cui-shadow-elevated);
    box-shadow: var(--cui-shadow-elevated);
}
.cm-modal-header.cm-modal-header-noDrag {
    cursor: default;
}
.cm-modal-body{
    flex: 1;
    padding: 20px;
}
.cm-modal-instance {
    .cm-modal-body {
        display: flex;
        flex-direction: row;
    }
    .cm-modal-left {
        width: 40px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }
    .cm-modal-header {
        height: 0;
        padding: 0;
    }
    .cm-modal-icon {
        font-size: 24px;
        display: inline-flex;
    }
    .cm-modal-icon-info {
        color: var(--cui-color-primary);
    }
    .cm-modal-icon-success{
        color: var(--cui-color-success);
    }
    .cm-modal-icon-warning{
        color: var(--cui-color-warning);
    }
    .cm-modal-icon-error{
        color: var(--cui-color-error);
    }
    .cm-modal-icon-confirm{
        color: var(--cui-color-primary);
    }
    .cm-modal-right {
        flex: 1;
    }
    .cm-modal-close {
        top: 20px;
    }
    .cm-modal-footer {
        box-shadow: none;
    }

    .cm-modal-confirm-content {
        padding-top: 8px;
    }
}
.cm-modal-header{
    position: relative;
    padding: 10px 20px;
    height: 40px;
    box-shadow: var(--cui-color-fill-1) 0px 0px 2px;
    cursor: move;
}
.cm-modal-close{
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translate(0, -50%);
    font-size: 16px;
    cursor: pointer;
    display: inline-flex;
    border-radius: 2px;
    transition: all 0.2s;
    padding: 2px;

    &:hover {
        background: var(--cui-color-fill-1);
    }
}
.cm-modal-footer{
    box-shadow: var(--cui-color-fill-1) 0px 0px 2px;
    text-align: right;
    padding: 10px 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    column-gap: 8px;
}
.cm-modal-footer-start {
    justify-content: flex-start;
}
.cm-modal-footer-end {
    justify-content: flex-end;
}

.cm-modal-footer-reverse {
    flex-direction: row-reverse;
}